from django.conf.urls import url
from rest_framework import routers
from rest_framework_jwt.views import obtain_jwt_token
from . import views

urlpatterns=[
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.CheckUserName.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$',views.CheckMobile.as_view()),
    url(r'^users/$',views.UserViewSet.as_view()),
    url(r'^authorizations/$', views.Login_Add_redis.as_view()),
    url(r'^accounts/(?P<account>\w{5,20})/sms/token/$',views.SMSCodeTokenView.as_view()),
    url(r'^sms_codes/$',views.SMSCodeByTokenView.as_view()),
    url(r'^accounts/(?P<account>\w{5,20})/password/token/$',views.PasswordTokenView.as_view()),
    url(r'^users/(?P<pk>\d+)/password/$',views.PasswordView.as_view()),
    url(r'^user/$',views.UserDetailView.as_view()),
    url(r'^emails/$',views.EmailView.as_view()),
    url(r'^emails/verification/$',views.VerifyEmailView.as_view()),
    url(r'^browse_histories/$',views.UserHistory.as_view()),
]
router = routers.DefaultRouter()
router.register(r'addresses', views.AddressViewSet, base_name='addresses')

urlpatterns += router.urls